package cn.nit.algorithm.controller;

/**
 * @author:刘祥棋
 * @data：2021/06/02 20:43:07
 */

import cn.nit.algorithm.experiment.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class AlgorithmController {
    @GetMapping("/experiment1")
    @ResponseBody
    public String experiment1() {
        Experiment1 e1 = new Experiment1();
        String re = e1.runMain();
        return re;
    }

    @GetMapping("/experiment2")
    @ResponseBody
    public String experiment2() {
        Experiment2 e = new Experiment2();
        String re = e.runMain();
        return re;
    }

    @GetMapping("/experiment3")
    @ResponseBody
    public String experiment3() {
        Experiment3 e = new Experiment3();
        String re = e.runMain();
        return re;
    }

    @GetMapping("/experiment4")
    @ResponseBody
    public String experiment4() {
        Experiment4 e = new Experiment4();
        String re = e.runMain();
        return re;
    }

    @GetMapping("/experiment5")
    @ResponseBody
    public String experiment5() {
        Experiment5 e = new Experiment5();
        String re = e.runMain();
        return re;
    }

    @GetMapping("/experiment6")
    @ResponseBody
    public String experiment6() {
        Experiment6 e = new Experiment6();
        String re = e.runMain();
        return re;
    }

    @GetMapping("/experiment7")
    @ResponseBody
    public String experiment7() {
        Experiment7 e = new Experiment7();
        String re = e.runMain();
        return re;
    }

    @GetMapping("/experiment9")
    @ResponseBody
    public String experiment7(String childString) {
        Experiment7 e = new Experiment7(childString);
        String re = e.runMain();
        return re;
    }

    @GetMapping("/experiment8")
    @ResponseBody
    public String experiment8(int number) {
        Experiment8 e = new Experiment8();
        String re = e.runMain(number);
        return re;
    }
}
